var socket = new WebSocket('ws://192.168.0.31:2200');
socket.onopen = function(){
    console.log('连接成功');
}
socket.onclose = function(){
    console.log('连接关闭');
}
socket.onerror = function(){
    console.log('发生错误');
}